package davidlauzon.activerecord.connection;


import davidlauzon.activerecord.ActiveRecord;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;


public class AndroidSqliteOpenHelper extends SQLiteOpenHelper
{
    /*********************************************************************************************
     * CONSTANTS
     *********************************************************************************************/
    
    
    /*********************************************************************************************
     * VARIABLES
     *********************************************************************************************/
    
    
    
    /*********************************************************************************************
     * INSTANCE METHODS
     *********************************************************************************************/
    public AndroidSqliteOpenHelper(Context context, String dbName, int dbVersion) {
        super(context, dbName, null, dbVersion);
    }
    
    @Override
    public void onCreate(SQLiteDatabase db) {
        log("TODO: Creating database.");
    }

    
    /**
     * TODO: should manage db updgrade instead of dropping + recreating (losing data) 
     */
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        log("TODO: Upgrading database from version " + oldVersion + " to " + newVersion);
    }
    
    protected void log(String msg) {
        Log.i(ActiveRecord.LOG_TAG, msg);
    }
}
